var express = require('express');
var router = express.Router();
var usersRouter = require("./users");

router.get("/",(req,res) =>{
  res.render("index",{title:"首页"})
})


router.get("/login",(req,res) =>{
  res.render("login",{title:"登录"})
})

router.get("/register",(req,res) =>{
  res.render("register",{title:"注册"})
})

router.get("/logout",(req,res) =>{
  res.send("退出网站")
})

router.get("/user/:id",(req,res) =>{
  res.send("用户个人空间")
})

router.get("/user/:id/profile",(req,res) =>{
  res.send("用户修改个人信息")
})

router.get("/post/create",(req,res) =>{
  res.render("create",{title:"发表文章"})
})

router.get("/post/:id",(req,res) =>{
  res.render("post",{title:"文章详情"})
})

router.get("/post/:id/edit",(req,res) =>{
  res.send("修改文章")
})





module.exports = function(app){
  app.use("/",router);
  app.use("./user",usersRouter);
}
